{% extends 'base_template/adminBase.html' %}

{% block main_content %}
    <div class="row-cols-auto">添加教员</div>
    <form action="{% url 'completeAddStaff' %}" method="post" id="demo-form" enctype="multipart/form-data">
        {% csrf_token %}
        <div class="input-group mb-3">
            <input type="text" class="form-control" placeholder="职工号" name="username">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <input type="text" class="form-control" placeholder="姓名" name="name">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <input type="email" class="form-control" placeholder="邮箱" name="email">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <input type="password" class="form-control" placeholder="密码" name="password">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-lock"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <input type="text" class="form-control" placeholder="手机号" name="phone">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <input type="text" class="form-control" placeholder="住址" name="address">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-lock"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <select class="form-control" name="sex">
                <option value="男">男</option>
                <option value="女">女</option>
            </select>
        </div>

        <div class="input-group mb-3">
            <input type="file" class="form-control" placeholder="照片" name="profile_pic">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-lock"></span>
                </div>
            </div>
        </div>
        <div class="input-group mb-3">
            <input type="text" class="form-control" placeholder="院系" name="dept">
            <div class="input-group-append">
                <div class="input-group-text">
                    <span class="fas fa-envelope"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <!-- /.col -->
            <div class="col-12">
                <button type="submit" class="btn btn-primary btn-block">完成注册</button>
            </div><!-- /.col -->

        </div>
        <div class="row">
            {% if messages %}
                <div class="col-12">
                    {% for message in messages %}
                        {% if message.tags == 'error' %}
                            <div class="alert alert-danger" style="margin-top:10px">{{ message }}</div>
                        {% endif %}
                        {% if message.tags == 'success' %}
                            <div class="alert alert-success" style="margin-top:10px">{{ message }}</div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
    </form>
{% endblock main_content %}